/*
 *MIT License
 *
 *Copyright (c) 2019 chenshuai cs4380@163.com
 *
 *Permission is hereby granted, free of charge, to any person obtaining a copy
 *of this software and associated documentation files (the "Software"), to deal
 *in the Software without restriction, including without limitation the rights
 *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *copies of the Software, and to permit persons to whom the Software is
 *furnished to do so, subject to the following conditions:
 *
 *The above copyright notice and this permission notice shall be included in all
 *copies or substantial portions of the Software.
 *
 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *SOFTWARE.
 */

package com.cs.cslc.admin.pojo;

import com.cs.cslc.common.pojo.BasePojo;
import com.cs.cslc.common.validate.AddField;
import com.cs.cslc.common.validate.UpdateField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * SysMenuButton 系统基础菜单按钮表.
 *
 * @author cs
 * @version 1.0
 * @date 2019-11-12 10:22
 * @description
 */
@Setter
@Getter
@Table(name = "sys_menu_button")
@ApiModel("系统基础菜单按钮")
public class SysMenuButton extends BasePojo implements Serializable {

    private static final long serialVersionUID = -5236506423780455951L;

    /**
     * 主键
     */
    @Id
    @ApiModelProperty("主键")
    @NotNull(groups = UpdateField.class)
    private Integer id;

    /**
     * 菜单id
     */
    @ApiModelProperty("菜单id")
    @NotBlank(groups = {AddField.class, UpdateField.class})
    @Size(max = 64, groups = {AddField.class, UpdateField.class})
    @Column(name = "menu_id")
    private String menuId;

    /**
     * 按钮编码
     */
    @ApiModelProperty("按钮编码")
    @NotBlank(groups = {AddField.class, UpdateField.class})
    @Size(max = 128, groups = {AddField.class, UpdateField.class})
    @Column(name = "button_code")
    private String buttonCode;

    /**
     * 按钮标题
     */
    @ApiModelProperty("按钮标题")
    @NotBlank(groups = {AddField.class, UpdateField.class})
    @Size(max = 64, groups = {AddField.class, UpdateField.class})
    @Column(name = "button_title")
    private String buttonTitle;

    /**
     * 请求地址
     */
    @ApiModelProperty("请求地址")
    @NotBlank(groups = {AddField.class, UpdateField.class})
    @Size(max = 256, groups = {AddField.class, UpdateField.class})
    @Column(name = "url")
    private String url;

    /**
     * 请求方式（POST|GET|DELETE|PUT）
     */
    @ApiModelProperty("请求方式（POST|GET|DELETE|PUT）")
    @NotBlank(groups = {AddField.class, UpdateField.class})
    @Size(max = 12, groups = {AddField.class, UpdateField.class})
    @Column(name = "method")
    private String method;

    /**
     * 菜单描述
     */
    @ApiModelProperty("菜单描述")
    @Column(name = "description")
    private String description;

    /**
     * 是否删除(1:删除|0:未删除)
     */
    @ApiModelProperty("是否删除")
    @Column(name = "is_deleted")
    private Integer isDeleted;
}